package com.shujia.wyh.day11;

/*
    throw：用在方法内部，方法体中，表示一定会出现某种异常

    throws,throw,finally理解。
 */
public class ExceptionDemo5 {
    public static void main(String[] args) {
        try {
            fun1();
        }catch (ArithmeticException e){
            e.printStackTrace();
        }

        System.out.println("HelloWorld");
    }

    public static void fun1() throws ArithmeticException{
        int a = 10;
        int b = 0;
        if(b==0){
            throw new ArithmeticException();
        }else {
            System.out.println(a/b);
        }

    }
}
